<!DOCTYPE html>
<html>
<head>
    <title>系统厂家</title>
    #parse("sys/header.html")
    <style>
        .sugon_upload_btn {
            display: -webkit-inline-box;
            display: inline-block;
        }
    </style>

</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="3">
                    <i-input v-model="q.name" @on-enter="query" placeholder="厂家名称"></i-input>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.code" @on-enter="query" placeholder="厂家编码"></i-input>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.selfCode" @on-enter="query" placeholder="厂家代号"></i-input>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.remark" @on-enter="query" placeholder="备注"></i-input>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                <Upload ref="uploadFile"
                        action="../factorytype/imports"
                        :format ="['xlsx','xls']"
                        :before-upload="handleBeforeUpload"
                        :on-success="handleSuccess" :on-error="handleError"
                        :show-upload-list="false"
                        :on-format-error="handleFormatError" class="sugon_upload_btn">
                    <i-button type="primary"><i class="fa fa-plus"></i>导入</i-button>
                </Upload>
                #if($shiro.hasPermission("factorytype:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("factorytype:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("factorytype:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="factoryType" :rules="ruleValidate" :label-width="80">
            <Row>
                <i-col span="11">
                    <Form-item label="厂家名称" prop="faName">
                        <i-input v-model="factoryType.faName" placeholder="名称"/>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="厂家代号" prop="selfCode">
                        <i-input v-model="factoryType.selfCode" placeholder="厂家代号"/>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="备注" prop="remark">
                        <i-input v-model="factoryType.remark" :rows="3" maxlength="255" show-word-limit type="textarea" placeholder="备注"/>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button type="primary" id="doSave" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload()" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/js/module/factorytype.js?_${date.systemTime}"></script>
</body>
</html>
